Skip to content

add ability to upmix channels with a filter#700

Open
Sipnol wants to merge 3 commits intoHaveAGitGat:masterfrom
Sipnol:enhance_ensure_audio_stream
Open

add ability to upmix channels with a filter#700
Sipnol wants to merge 3 commits intoHaveAGitGat:masterfrom
Sipnol:enhance_ensure_audio_stream

Conversation

@Sipnol
Copy link
Copy Markdown

@Sipnol Sipnol commented Oct 13, 2024

No description provided.

if (enableBitrate) {
const ffType = getFfType(streamCopy.codec_type);
streamCopy.outputArgs.push(`-b:${ffType}:{outputTypeIndex}`, `${bitrate}`);
streamCopy.outputArgs.push('-b:a:{outputTypeIndex}', `${bitrate}`);
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so i removed the getType here because we filter the streams to only include audio anyway.

if (targetChannels > highestChannelCount && upmixingFilter !== '') {
streamCopy.outputArgs.push('-filter_complex', `[${streamCopy.mapArgs[1]}]${upmixingFilter}[a_{outputIndex}]`);
streamCopy.outputArgs.push('-map', '[a_{outputIndex}]');
streamCopy.mapArgs = [];
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to remove the mapArgs here because otherwise the source will be copied twice

@Sipnol
Copy link
Copy Markdown
Author

Sipnol commented Oct 17, 2024

Also noticed that if you have multiple blocks of this in one ffmpeg command it will override some settings so i fixed that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant